<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script>
        //   try {
        //     console.log(msg)
        //   } catch (err) {
        //     console.log(err)
        //   }
        //   console.log('44')

        // try-catch 让我们的js代码更加健壮，不会影响后续代码的执行
        async function xxx() {
            try {
                const res = await axios({
                    url: 'http://ajax-api.itheima.net/api/books/999',
                })
                console.log(res)
            } catch (err) {
                console.log('err333', err)
            }

            console.log(666)
        }
        xxx()
    </script>
</body>

</html>